The Look ('look') Resource
The look ('look'
) resource specifies the kinds of communications that a driver uses. It contains a list of entries, each of which can be used when the user creates a desktop printer with the Chooser. The values in the look resource are also used for printer sharing; you must include a communications resource for each entry in the look resource to make printer sharing work properly. Figure 6-10 shows the structure of a look resource.
The look resource consists of a default indicator, a count, and one or more "looker" entries.
Each looker entry tells QuickDraw GX about one kind of communications that the driver can perform and includes the following fields:
- Default selection. A value that specifies which looker entry is the default.
- Count. The number of looker entries in this resource.
Table 6-13 shows the constants that you can use to specify the kind of connection that a driver uses.
- Looker name. The name to display in the list of communications choices that are presented to the user.
- Communications ID. The resource ID of the communications (
'comm'
) resource that corresponds to this looker entry.- Looker flags. A collection of flags that can be combined to define what kind of connection the entry is naming. The flag constants shown are in Table 6-13.
- Item name. The name that is displayed for the item in the Chooser. For serial connections, this is the default port name. For AppleTalk and PrinterShare connections, this is the name-binding protocol (NBP) type.
The look resource ID needs to be the constant -4096. Listing 6-9 shows an example of a look resource.
Listing 6-9 An example of a look resource
resource 'look' (-4096, sysHeap, purgeable) { 2, /* use the 2nd entry in list as default */ { "AppleTalk", -4096, isAppleTalk, "ImageWriter"; "Serial", -4095, iconCells, "Modem Port"; "Servers", -4094, isAppleTalk+isPrinterShare, "ImageWriterIIIS"; }; };This is a look resource for an ImageWriter II printer, which supports PAP (the Printer Access Protocol used in AppleTalk), serial, and PrinterShare communications interfaces. The communications resource that defines the AppleTalk interface has resource ID -4096, the communications resource for the serial interface has resource ID -4095, and the communications resource for the PrinterShare interface has resource ID -4094. The default connection type is serial, the Chooser uses icons for choosing the serial connection port, and the default icon that would be selected by the Chooser is the "Modem Port" icon.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help